package game;

import java.awt.Graphics2D;
import java.awt.Point;

public class Inimigo_05 extends BaseEnemy
{
	
	private static final long serialVersionUID = 1L;

	public boolean invisible = true;
	
	private float time, drawTime;
	private float nextTime = (float)(Game.rand.nextInt(3) + Game.rand.nextFloat());
	
	public Inimigo_05(int indexImage, Point position, Point size, Point sPos,
			Point recorte, Point rowLine, float time, boolean input, int HP,
			float speedShoot2) 
	{
		super(indexImage, position, size, sPos, recorte, rowLine, time, input, HP,
				speedShoot2);
		
		isBomber = true;
	}
	
	@Override
	public void Update(Player p) 
	{
		automatic = true;
		super.Update(p);
		
		time += Time.getInstance().getLoopTime();
		
		if(time >= nextTime)
		{
			if(invisible == false)
			{
				invisible = true;
				time = 0;
				nextTime = (float)(Game.rand.nextInt(3) + Game.rand.nextFloat());
			}
			else
			{
				invisible = false;
				time = 0;
				nextTime = (float)(Game.rand.nextInt(3) + Game.rand.nextFloat());
			}
			
		}
	}
	
	@Override
	public void draw(Graphics2D g2d) 
	{
		if(invisible != true)
		{
			super.draw(g2d);
			
		}
		
		
	}
}
